This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andreamah
requested review from
abmahdy,
adclements,
iennae,
isadorasophia,
markAtMicrosoft,
nasadigital,
sagarmanchanda and
smmatte
as code owners
March 28, 2020 02:08
isadorasophia
approved these changes
Mar 30, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR description!! 💛 LGTM
…rosoft/vscode-python-devicesimulator into users/t-anmah/clue-slideshow
vandyliu
reviewed
Apr 1, 2020
vandyliu
reviewed
Apr 1, 2020
vandyliu
approved these changes
Apr 1, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Implementing backend library for Adafruit Slideshow (front end is already taken care of, since the backend sends frame-by-frame).
ORIGINAL CODE BY ADAFRUIT: https://github.com/adafruit/Adafruit_CircuitPython_Slideshow/blob/master/adafruit_slideshow.py
DOCS: https://circuitpython.readthedocs.io/projects/slideshow/en/latest/api.html
File breakdown:
adafruit_slideshow.py: all of the libraries needed to run a slideshow
--> The SlideShow class is the main class containing slideshow model. There are two ways of proceeding: advance() and update(). Advance() will definitely change the active slideshow photo, whereas update() will check the last time you advanced and will only advance if
SlideShow.dwell
seconds has passed. If auto_advance is False, update() will never work.--> self.BASE_DWELL and self.BASE_DWELL_DARK exist as a bit of a buffer to add when the photos are fully shown and when the screen is "dark" (applicable during fade effect) respectively. Using no delay on top of the self.dwell value seemed to have made the animation too fast
test_adafruit_slideshow.py: tests for slideshow
--> only iterates forwards and backwards on the photos using advance()
Extra features:
Since this library supports relative file locations, I needed to get the address to the users's file. This was already done in the CPX code, so I modified it so that this was stored in common instead. Thus, both CPX and CLUE could access this value.
Type of change
Limitations:
Please describe limitations of this PR
Testing:
Below are some tests that I ran. The "img" folder contained ~6 images that fell into one of these categories for height and width:
I also tested with invalid .bmp images and .png images to make sure that they were properly skipped.
Checklist:
npm run format
and passes the checks innpm run check